#include<ros/ros.h>
#include<geometry_msgs/Twist.h>
/*
    需求：发布消息
        话题: /turtle1/cmd_
        消息： geometry_msgs/Twist

    1.
    2.
    3.
    4.创建发布对象
    5.发布逻辑
    6.spinOnece()

*/


int main(int argc, char *argv[])
{
    
    ros::init(argc,argv,"my_control");

    ros::NodeHandle nh;


    ros::Publisher pub = nh.advertise<geometry_msgs::Twist>("/turtle1/cmd_vel",10);
    ros::Rate rate(10);


    geometry_msgs::Twist twist;
    twist.linear.x = 0.1;
    twist.linear.y = 0.0;
    twist.linear.y = 0.0;


    twist.angular.x = 0.0;
    twist.angular.y = 0.0;
    twist.angular.z = 0.05;


    while (ros::ok())
    {
        /* code */
        pub.publish(twist);
        rate.sleep();
        ros::spinOnce();
    }

    
    


    return 0;
}
